package com.github.tommas.admintpl.dao;

import com.github.tommas.admintpl.bean.model.User;
import com.github.tommas.admintpl.mybatis.Context;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {
    List<User> searchUserList();

    User findUser(Integer id);

    User findUserWithPassword(String username, String password);

    User findUserByUsername(String username);

    int createUser(Context ctx, User user);

    int updateUser(Context context, User user);

    int deleteUser(Context context, Integer id);

    int deleteUserRoles(Integer userId);

    int insertUserRoles(Integer userId, List<Integer> roleIds);

    int deleteUserEntities(Integer userId);

    int insertUserEntities(Integer userId, List<Integer> entityIds);

    List<Integer> findUserEntities(Integer userId);
}
